<template>
  <div class="tops" :style="randomRgb()">
    <div class="right" @click="huan"><slot></slot></div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  mounted() {},
  methods: {
    huan() {
      this.$router.go(0);
    },
    randomRgb() {
      let R = Math.floor(Math.random() * 255);
      let G = Math.floor(Math.random() * 255);
      let B = Math.floor(Math.random() * 255);
      return {
        background: "rgb(" + R + "," + G + "," + B + ")",
      };
    },
  },
};
</script>

<style lang='scss' scoped>
.tops {
  width: 100%;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: aqua;
  color: white;
}

.right {
  width: 100%;
  text-align: center;
}
</style>
